import http from "@/api";

/**
 * 音乐列表
 */
export const musicListApi = (params: object) => {
    return http.get(`/music/list`, params);
};

/**
 * 音乐分页列表
 */
export const musicPageListApi = (params: object) => {
    return http.get(`/music/paging`, params);
};

/**
 * 新增音乐
 * @param params
 */
export const addMusicApi = (params: object) => {
    return http.post(`/music/add`, params);
};

/**
 * 编辑音乐
 * @param params
 */
export const editMusicApi = (params: any) => {
    return http.put(`/music/edit/${params.id}`, params);
};

/**
 * 切换音乐状态
 * @param id
 */
export const changeStatusApi = (id: number) => {
    return http.put(`/music/change_status/${id}`);
};

/**
 * 修改排序
 * @param params
 */
export const changeSortApi = (params: object) => {
    return http.post(`/music/changeSort`, params);
};

/**
 * 删除音乐
 * @param id
 */
export const deleteMusicByIdApi = (id: number) => {
    return http.delete(`/music/delete/${id}`);
};

/**
 * 批量删除
 * @param params
 */
export const deleteMusicApi = (params: object) => {
    return http.post(`/music/delete`, params);
};
